package com.hl.ruoyicsmshop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hl.ruoyicsmshop.mapper.KillActivityMapper;
import com.hl.ruoyicsmshop.domain.KillActivity;
import com.hl.ruoyicsmshop.service.IKillActivityService;

/**
 * 秒杀活动Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-09
 */
@Service
public class KillActivityServiceImpl implements IKillActivityService 
{
    @Autowired
    private KillActivityMapper killActivityMapper;

    /**
     * 查询秒杀活动
     * 
     * @param kaId 秒杀活动主键
     * @return 秒杀活动
     */
    @Override
    public KillActivity selectKillActivityByKaId(Long kaId)
    {
        return killActivityMapper.selectKillActivityByKaId(kaId);
    }

    /**
     * 查询秒杀活动列表
     * 
     * @param killActivity 秒杀活动
     * @return 秒杀活动
     */
    @Override
    public List<KillActivity> selectKillActivityList(KillActivity killActivity)
    {
        return killActivityMapper.selectKillActivityList(killActivity);
    }

    /**
     * 新增秒杀活动
     * 
     * @param killActivity 秒杀活动
     * @return 结果
     */
    @Override
    public int insertKillActivity(KillActivity killActivity)
    {
        killActivity.setCreateTime(DateUtils.getNowDate());
        return killActivityMapper.insertKillActivity(killActivity);
    }

    /**
     * 修改秒杀活动
     * 
     * @param killActivity 秒杀活动
     * @return 结果
     */
    @Override
    public int updateKillActivity(KillActivity killActivity)
    {
        killActivity.setUpdateTime(DateUtils.getNowDate());
        return killActivityMapper.updateKillActivity(killActivity);
    }

    /**
     * 批量删除秒杀活动
     * 
     * @param kaIds 需要删除的秒杀活动主键
     * @return 结果
     */
    @Override
    public int deleteKillActivityByKaIds(Long[] kaIds)
    {
        return killActivityMapper.deleteKillActivityByKaIds(kaIds);
    }

    /**
     * 删除秒杀活动信息
     * 
     * @param kaId 秒杀活动主键
     * @return 结果
     */
    @Override
    public int deleteKillActivityByKaId(Long kaId)
    {
        return killActivityMapper.deleteKillActivityByKaId(kaId);
    }
}
